<div id="admin_permissions">
  <p>
    <a href="<%= new_admin_permission_path %>" class="btn btn-success btn-sm">
      <su-icon icon="plus" color="#fff" fix-width></su-icon>新增
    </a>
  </p>
  <%= grid(@permissions, show_filters: :when_filtered) do |g|
    #g.action_column param_name: :select_ids, object_property: :id
    #g.column name: "<i class='fa fa-asterisk fa-fw'></i>", attribute: 'id', filter: false, ordering: true
            g.column name: "#{t 'activerecord.attributes.permission.description'}", attribute: 'description'
            g.column name: "#{t 'activerecord.attributes.permission.action'}", attribute: 'action'
            g.column name: "#{t 'activerecord.attributes.permission.subject'}", attribute: 'subject'
            g.column name: "#{t 'activerecord.attributes.permission.fetching'}", attribute: 'fetching'
            g.column name: "#{t 'activerecord.attributes.permission.code'}", attribute: 'code'
            g.column name: "#{t 'activerecord.attributes.permission.position'}", attribute: 'position'
            g.column name: "#{t 'activerecord.attributes.permission.group'}", assoc: :group, attribute: 'name' do |c|
              c.group.name if c.group_id.present?
            end

    g.column do |c|
      grid_operator(:admin_permission_path, c.id)
    end
  end %>
</div>
<script type="text/javascript" data-turbolinks-eval="true">
  new Vue({
    el: "#admin_permissions"
  })
</script>